/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.container {
    display: flex;
    min-height: 100vh;
    position: relative;
}





/* 主内容区自适应侧边栏 */
.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
    margin-left: 2px;
}


/* 五线谱区域样式 */
.staff-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}



/* 状态显示区域样式 */
.status-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    transition: background-color 0.3s;
}

#startBtn {
    background-color: #4CAF50;
    color: white;
}

#stopBtn {
    background-color: #f44336;
    color: white;
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.feedback {
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.feedback.correct {
    background-color: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    display: block;
}

.feedback.incorrect {
    background-color: rgba(244, 67, 54, 0.2);
    color: #c62828;
    display: block;
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-8px); }
    80% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}
.feedback.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* 钢琴区域样式 */
.piano-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-top: 32px;
}

.piano {
    position: relative;
    height: 200px;
    display: flex;
    align-items: flex-end;
    margin: 0 auto;
    padding: 0 20px;
}

.white-key {
    position: relative;
    width: 36px;
    height: 180px;
    background: linear-gradient(#fff 96%, #eee 4%);
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    z-index: 1;
    margin-right: 0;
    margin-left: -1px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.black-key {
    position: absolute;
    width: 22px;
    height: 100px;
    background: linear-gradient(#333, #000);
    border: 1px solid #000;
    border-radius: 0 0 3px 3px;
    z-index: 2;
    margin-left: 0;
    left: 0;
    top: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
}

.key-label {
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: #666;
    pointer-events: none;
}

.black-key .key-label {
    color: #fff;
    bottom: 6px;
}

/* 五线谱线条样式 */
.staff-line {
    stroke: #000;
    stroke-width: 3;
}
.ledger-line {
    stroke: transparent;
    stroke-width: 3;
}


.note {
    fill: #000;
}

.accidental {
    fill: #000;
    font-size: 30px;
}

.white-key.active {
    background: linear-gradient(#ffd966 96%, #e0c96b 4%);
    box-shadow: 0 2px 16px #e6b800 inset, 0 0 8px #ffd966;
    z-index: 3;
}
.black-key.active {
    background: linear-gradient(#ff6666, #b30000);
    box-shadow: 0 2px 16px #b30000 inset, 0 0 8px #ff6666;
    z-index: 4;
}

.setting-item {
    margin: 24px 0;
}

.switch-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    display: inline-block;
    margin-top: 6px;
}
.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-label {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ddd;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}
.switch-inner {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px #aaa;
    transition: left 0.3s;
    z-index: 2;
}
input:checked + .switch-label .switch-inner {
    left: 34px;
}
.switch-text {
    font-size: 18px;
    color: #666;
    z-index: 1;
    user-select: none;
}
.switch-text.sharp {
    margin-right: 18px;
}
.switch-text.flat {
    margin-left: 18px;
} 